#include "model.h"

void my_delay(){
    time_t delay = 1; // 3 sec.
    time_t later = time(NULL) + delay;
    while (time(NULL) != later);
}

//un system("PAUSE") portable
void my_press_enter()
{
	char temp[100];
	fgets(temp,100,stdin);
}

int get_random( int element, int one, int two, int more ){
    int tmp = 0, seed = 0;
    if ( more == 0 ){
         seed = time(NULL);
    }else{
         seed = time(NULL) + more; 
    }
    //printf("time= %d", seed);
    srand(seed);
    tmp = (rand() % (element-one)) + two;
    return tmp;
}


//cette fonction ne fait rien si DEBUG n'est pas defini
//sinon elle affiche le message qu'on lui passe
void msg(char *format,...)
{
	#ifdef DEBUG
	va_list args;
	va_start(args,format);
	vprintf(format,args);
	va_end(args);
	#endif
}

